import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
    {
      path: "/",
      // redirect重定向
      redirect: "/home"
    },
    {
      path: '/gen_movie',
      name: 'GenMovie',
      component: () =>
          import ('../views/GenMovie.vue')
    },
    {
      path: '/home',
      name: 'Home',
      component: () =>
          import ('../views/Home.vue')
    },
    {
      path: '/gen_movie_des',
      name: 'GenMovieDes',
      component: () =>
          import ('../views/GenMovieDes.vue')
    },
    {
      path: '/set_picture',
      name: 'SetPicture',
      component: () =>
          import ('../views/SetPicture.vue')
    },
    {
      path: '/ai_picture',
      name: 'AIPicture',
      component: () =>
          import ('../views/AIPicture.vue')
    },
    {
      path: '/ai_video',
      name: 'AIVideo',
      component: () =>
          import ('../views/AIVideo.vue')
    },
    {
      path: '/ai_person',
      name: 'AIPerson',
      component: () =>
          import ('../views/AIPerson.vue')
    },
    {
      path: '/ai_music',
      name: 'AIMusic',
      component: () =>
          import ('../views/AIMusic.vue')
    },
    {
      path: '/result_music',
      name: 'ResultMusic',
      component: () =>
          import ('../views/ResultMusic.vue')
    },
    {
      path: '/result_person',
      name: 'ResultPerson',
      component: () =>
          import ('../views/ResultPerson.vue')
    },
    {
      path: '/change_password',
      name: 'ChangePassword',
      component: () =>
          import ('../views/ChangePassword.vue')
    },
    {
      path: '/contact_us',
      name: 'ContactUs',
      component: () =>
          import ('../views/ContactUs.vue')
    },
 
    {
      path: '/forget_password',
      name: 'ForgetPassword',
      component: () =>
          import ('../views/ForgetPassword.vue')
    },
    {
      path: '/gen_picture',
      name: 'GenPicture',
      component: () =>
          import ('../views/GenPicture.vue')
    },
    {
      path: '/gen_story',
      name: 'GenStory',
      component: () =>
          import ('../views/GenStory.vue')
    },
    {
      path: '/login',
      name: 'Login',
      component: () =>
          import ('../views/Login.vue')
    },
    {
      path: '/price',
      name: 'Price',
      component: () =>
          import ('../views/Price.vue')
    },
    {
      path: '/question',
      name: 'Question',
      component: () =>
          import ('../views/Question.vue')
    },
    {
      path: '/register',
      name: 'Register',
      component: () =>
          import ('../views/Register.vue')
    },
    {
      path: '/set_movie',
      name: 'SetMovie',
      component: () =>
          import ('../views/SetMovie.vue')
    },
    {
      path: '/start_up',
      name: 'StartUp',
      component: () =>
          import ('../views/StartUp.vue')
    },
    {
      path: '/cut_movie',
      name: 'CutMovie',
      component: () =>
          import ('../views/CutMovie.vue')
    },
    {
      path: '/input_con',
      name: 'InputCon',
      component: () =>
          import ('../views/InputCon.vue')
    },
]

const router = new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routes,
    scrollBehavior(to, from, savedPosition) {
        if (savedPosition) {
          return savedPosition
        } else {
          return { x: 0, y: 0 }
        }
      }
    
})

export default router